package com.ssm.user.designPattern.abstractFactoryPattern.easy.Color;


import com.ssm.user.designPattern.abstractFactoryPattern.easy.AbstractFactory;
import com.ssm.user.designPattern.abstractFactoryPattern.easy.Shape.Shape;

public class ColorFactory extends AbstractFactory { //继承抽象工厂类
    //根据getColor方法获取颜色类型的对象
    public Color getColor(String colorType) {
        if(colorType == null) {
            return null;
        }

        if(colorType.equalsIgnoreCase("Red")) {
            return new Red();
        } else if(colorType.equalsIgnoreCase("Blue")) {
            return new Blue();
        }
        return null;
    }

    @Override
    public Shape getShape(String shape) { //不需要管shape
        return null;
    }
}
